<template>
  <view class="settlement-contatiner">
    <label class="radio" @click="changeState">
      <radio color="#c00000" :checked="chekState"/><text>全选</text>
    </label>
    <view class="settlement-money">
      合计：<text>￥{{checkedGoodsAmount}}</text>
    </view>
    <view class="settlement-acount">
      结算({{checkedCount}})
    </view>
  </view>
</template>

<script>
  import{mapGetters,mapMutations} from 'vuex'
  export default {
    name:"my-settlement",
    data() {
      return {
        
      };
    },
    computed:{
      ...mapGetters('m_cart',['checkedCount','total','checkedGoodsAmount']),
      chekState(){
        return this.total === this.checkedCount
      }
    },
    methods:{
      ...mapMutations('m_cart',['updateAllState']),
      changeState(){
        console.log(!this.chekState)
        this.updateAllState(!this.chekState)
      }
    }
  }
</script>

<style lang="scss">
.settlement-contatiner{
  position: fixed;
  left: 0;
  bottom: 0;
  padding-left: 5px;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  font-size: 14px;
  z-index: 99;
  .radio{
    
  }
  .settlement-money{
    text{
      font-weight: bold;
      color: #c00000;
    }
  }
  .settlement-acount{
    height: 50px;
    min-width: 100px;
    line-height: 50px;
    color: white;
    text-align: center;
    background: #c00000;
  }
}
</style>
